package test2_annonation.impl;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import test2_annonation.BookDao2;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.nio.DoubleBuffer;


@Component("BookDao2")

//默认是单例，scope可以配置是否是单例
//@Scope("prototype")
public class BookDao2Impl implements BookDao2 {

    public void search() {
        System.out.println("book dao 2 search!");
    }

    @PostConstruct
    public void init(){
        System.out.println("book dao 2 init");
    }

    @PreDestroy
    public void destory(){
        System.out.println("book dao 2 desotry");
    }
}
